#pragma once

#include <cmath>
#include "gtest/gtest.h"
#include "DataStructure/Common/Constant.h"
#include "../Gauss2D1X1P.h"

using SG::DataStructure::Common::TOLERANCE;
using SG::FEMSolver::Element::Gauss2D1X1P;

class Gauss2D1X1PTest : public ::testing::Test
{
public:
    void SetUp () override
    {
        m_integForm = Gauss2D1X1P ();
    }
protected:
    Gauss2D1X1P m_integForm;
};

TEST_F (Gauss2D1X1PTest, GetPointSize)
{
    ASSERT_TRUE (1 == m_integForm.GetPointSize ());
}

TEST_F (Gauss2D1X1PTest, GetPoint)
{
    // Test data
    auto point = m_integForm.GetPoint (0);

    // Check Point 1
    ASSERT_NEAR (point.m_weight, 4.0, TOLERANCE);
    ASSERT_NEAR (point.m_x, 0.0, TOLERANCE);
    ASSERT_NEAR (point.m_y, 0.0, TOLERANCE);
    ASSERT_NEAR (point.m_z, 0.0, TOLERANCE);
}